package net.comm.param.db;

import org.sakaiproject.db.api.iServiceSql;


/**
 * methods for accessing user data in a database.
 */
public class SequenceMgrServiceSqlMysql implements iServiceSql
{
	/**
	 * 返回根据主键删除语句
	 */
	public String getDeleteSql()
	{
		return "delete from seqctrl where Seqtype=?  and date=? ";
	}

	/**
	 * 返回插入语句
	 */
	public String getInsertSql()
	{
		return "insert into seqctrl ( seqtype,  date,  maxseq )" +
				" values (?,?,?)";
	}
	
	/**
	 * 返回根据主键修改语句
	 */
	public String getUpdateSql()
	{
		return "update seqctrl  set maxseq=? " +
				" where  Seqtype=?  and date=? ";
	}

	/**
	 * 返回根据主键查询语句
	 */
	public String getbykeySql()
	{
		return "select seqtype,  date,  maxseq " +
				" from seqctrl where  Seqtype=?  and date=? ";
	}
	
	/**
	 * 返回根据主键查询锁定语句
	 */
	public String getbykeyUpdSql()
	{
		return "select seqtype,  date,  maxseq " +
				" from seqctrl where Seqtype=? and date=? for UPDATE";
	}

	/**
	 * return the sql statement which updates an external user id for a given user in the sakai_user_id_map table.
	 */
	public String getRecbyPageSql()
	{
	
		return null;	
	}	

	
	/**
	 * 返回所有记录数
	 */
	public String getCountSql1()
	{
		return "select count(*) as COUNT from seqctrl ";
	}

	/**
	 * @see net.comm.job.db.iServiceSql.impl.UserServiceSql#getMaxInputsForSelectWhereInQueries()
	 */
	public int getMaxInputsForSelectWhereInQueries() {
		// For Oracle, the maximum supported number of expressions in a list is 1000. 
		return 1000;
	}

	public String getCountSql2() {
		// TODO Auto-generated method stub
		return null;
	}
}
